# 其他复习
from datetime import *


def knapsack_std(weights: list[int], values: list[int], capacity):
    # 01背包基础解法
    n = len(weights)
    dp = [[0] * (capacity + 1) for _ in range(n + 1)]
    for i in range(1, n + 1):  # 遍历每一个物体
        weight, value = weights[i - 1], values[i - 1]
        for j in range(1, capacity + 1):  # 遍历每一个背包的重量
            if j >= weight:  # 如果能放下
                dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - weight] + value)
            else:
                dp[i][j] = dp[i - 1][j]
    return dp[n][capacity]


def knapsack_std_opt(weights: list[int], values: list[int], capacity):
    # 01背包高阶解法
    dp = [0] * (capacity + 1)
    for idx, weight in enumerate(weights):
        value = values[idx]
        for i in range(capacity, -1, -1):
            if i >= weight:
                dp[i] = max(dp[i], dp[i - weight] + value)

    return dp[capacity]


def jogging_plan():
    fmt = "%Y-%m-%d %A"
    curr = datetime(year=2023, month=1, day=1)
    res = 0
    while curr.year == 2023:
        s = curr.strftime(fmt)
        if "Mon" in s or "1" in s:
            res += 5
        else:
            res += 1
        curr += timedelta(days=1)
    return res

if __name__ == '__main__':
    # print(knapsack_std([2, 5, 3, 1, 8], [4, 5, 6, 5, 13], 10))
    # print(knapsack_std_opt([2, 5, 3, 1, 8], [4, 5, 6, 5, 13], 10))
    print(jogging_plan())  # 1333